/**
 * Created with IntelliJ IDEA.
 * Description:递归求和
 * User: zjc
 * Date: 2022-05-10
 * Time: 23:27
 */
public class Project {
    public static void main(String[] args) {
        int n = 10;
        int sum = fac(n);
        System.out.println(sum);
    }
    public static int fac(int n) {
        if(n == 1){
            return 1;
        }else{
            return n + fac(n - 1);
        }
    }
}
